package javabase.singleton;

public final class SynLazySingletonLight2 {
	// 防止指令重排方法二
	private static volatile SynLazySingletonLight2 LazySingleton = null;
	private SynLazySingletonLight2 () {
		
	}
	public static SynLazySingletonLight2 getLazySingleton() {
		if (LazySingleton == null) {
			synchronized (SynLazySingletonLight2.class) {
				if (LazySingleton == null) {
					LazySingleton = new SynLazySingletonLight2();
				}
			}
			LazySingleton = new SynLazySingletonLight2();
		}
		return LazySingleton;
	}
}
